package com.sykj.springboot;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class test08172 {

  @Test
  public void test01(){
    // 代码块1
//    short s1 = 1; s1 = s1 + 1;
    // 代码块2
    short s1 = 1; s1 += 1;

    Integer a = 128, b = 128, c = 127, d = 127;
    System.out.println(a == b);
    System.out.println(c == d);

  }


  @Test
  public void test1(){
    for (;;) {
      System.out.println("s==2222t");
    }
  }



  @Test
  public void test2(){
    StringBuffer a = new StringBuffer("A");
    StringBuffer b = new StringBuffer("B");
    operat(a,b);
    System.out.println(a+","+b);

    String str = null;
    System.out.println(isEmptyString(str));
//    System.out.println(isEmptyString2(str));


    Integer s = new Integer( 9 );
    Integer t = new Integer( 9 );
    Long u = new Long( 9 );

    System.out.println(s.hashCode());
    System.out.println(t.hashCode());
    if (s==t){
      System.out.println("s==t");
    }
    if (s.equals(u)){
      System.out.println("s.equals(u)");
    }
    if (s.equals(t)){
      System.out.println("s.equals(t)");
    }
    if (s.equals(9)){
      System.out.println("s.equals(9)");
    }




  }

  public boolean isEmptyString(String str) {
    return str == null || str.length() == 0;
  }

  public boolean isEmptyString2(String str) {
    return str.length() == 0 || str == null;
  }



  public static void operat(StringBuffer x,StringBuffer y){
    x.append(y);
    y=x;
  }

}
